package chixing.day08.abstract_demo;

public class AbsractTest {
    public static void main(String[] args) {
        //instantiated 实例化 = 创建对象
        //instant 实例(对象)

        //因为A时抽象类所以不能被实例化
//        A a = new A();    error

        C c1 = new C();
        A a1 = new C();

        D d1 = new D();
        A a2 = new D();


        fun(c1);
        fun(a1);
        fun(d1);
        fun(a2);
    }

    //形参是抽象类实参一定是该类的子类对象
    public static void fun(A a){}
}
